<template>
	<view class="member">
		<view class="user-mesg">
			<view class="user">
				<image src="../../static/logo.png"></image>
				<view class="name">
					<view class="title">
						{{people.name | judgeName}}
					</view>
					<view class="num" style="color: #000000;">
						会员编号:
						<span style="color: #007AFF;">1231231231321231</span>
					</view>
				</view>
				<view @click="goUpdatePage" class="update">
					修改资料
				</view>
			</view>
			<view class="integral">
				<view class="grade">{{people.grade}}</view>
				正式积分
			</view>
		</view>

		<view class="information">
			<view class="title">
				信息管理
			</view>
			<view class="all-moudle">
				<view v-for="(item,index) in module" :key="index">
					<view @click="goMessageManage(index)" class="moudle">
						<van-icon v-if="item.info == 1" name="chat" size="50px" dot />
						<van-icon v-else-if="item.info>1" name="chat" size="50px" :info="item.info" />
						<van-icon v-else name="chat" size="50px" />
						{{item.name}}
					</view>

				</view>
			</view>
		</view>

		<view class="information">
			<view class="title">
				积分管理
			</view>
			<view class="all-moudle">
				<view v-for="(item,index) in integral" :key="index">
					<view class="moudle">
						<van-icon v-if="item.info == 1" name="chat" size="50px" dot />
						<van-icon v-else-if="item.info>1" name="chat" size="50px" :info="item.info" />
						<van-icon v-else name="chat" size="50px" />
						{{item.name}}
					</view>
				</view>
			</view>
		</view>

		<view class="information">
			<view class="title">
				系统设置
			</view>
			<view class="all-moudle">
				<view v-for="(item,index) in system" :key="index">
					<view class="moudle">
						<van-icon v-if="item.info == 1" name="chat" size="50px" dot />
						<van-icon v-else-if="item.info>1" name="chat" size="50px" :info="item.info" />
						<van-icon v-else name="chat" size="50px" />
						{{item.name}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				people: {
					name: "测试",
					grade: "12",
				},
				module: [{
					name: "我的招工",
					img: "../static/logo.png",
				}, {
					name: "我的找活",
					img: "../static/logo.png",
				}, {
					name: "二手交易",
					img: "../static/logo.png",
				}, {
					name: "我的收藏",
					img: "../../static/logo.png",
				}, {
					name: "记功记账",
					img: "../static/logo.png",
				}, {
					name: "我的消息",
					img: "../../static/logo.png",
					info: 1
				}, {
					name: "免费领好礼",
					img: "../static/logo.png",
				}],
				integral: [{
					name: "获取积分",
					img: "../static/logo.png",
				}, {
					name: "积分记录",
					img: "../static/logo.png",
				}, {
					name: "邀请工友",
					img: "../static/logo.png",
				}],
				system: [{
					name: "实名认证",
					img: "../static/logo.png",
				}, {
					name: "实名查询",
					img: "../static/logo.png",
				}, {
					name: "帮助与反馈",
					img: "../static/logo.png",
				}, {
					name: "联系客服",
					img: "../static/logo.png",
				}, {
					name: "系统设置",
					img: "../static/logo.png",
				}]
			}
		},
		methods: {
			goUpdatePage() {
				uni.navigateTo({
					url:"updatepage/updatePage"
				})
			},
			goMessageManage(index){
				if(index == 0){
					uni.navigateTo({
						url:'messagemoudel/myRecruit'
					})
				}else if(index == 1){
					uni.navigateTo({
						url:'messagemoudel/businessCard'
					})
				}else if(index == 2){
					uni.navigateTo({
						url:'messagemoudel/myDeal',
					})
				}
			}
		},
		filters: {
			judgeName(name) {
				return name ? name : "先生"
			}
		}
	}
</script>

<style lang="scss" scoped>
	.member {
		background: #d4d4d4;
		display: flex;
		flex-direction: column;
		align-items: center;

		.user-mesg {
			background: #FFFFFF;
			width: 90vw;
			padding: 40rpx 20rpx 20rpx 20rpx;
			border-radius: 30rpx;
			margin-bottom: 20rpx;

			.user {
				display: flex;
				justify-content: center;
				align-items: center;
				margin-bottom: 20rpx;

				image {
					width: 120rpx;
					height: 120rpx;
					border-radius: 999rpx;
					margin-right: 20rpx;
				}

				.name {
					margin-right: 20rpx;
					font-size: 34rpx;
					font-weight: bold;
					width: 300rpx;

					.num,
					.title {
						font-size: 30rpx;
						margin-top: 20rpx;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
					}

					.title {
						margin-top: 0;
					}
				}

				.update {
					border: solid 1px #818181;
					color: #818181;
					padding: 10rpx 6rpx;
					font-size: 30rpx;
					border-radius: 10rpx;
				}
			}

			.integral {
				border-top: solid 1px #d1d1d1;
				padding-top: 20rpx;
				text-align: center;

				.grade {
					color: #007AFF;
				}
			}
		}

		.information {
			background: #FFFFFF;
			width: 90vw;
			padding: 20rpx;
			border-radius: 30rpx;
			margin-bottom: 20rpx;

			.title {
				font-size: 34rpx;
				font-weight: bold;
			}

			.all-moudle {
				display: flex;
				flex-wrap: wrap;

				.moudle {
					display: flex;
					flex-direction: column;
					justify-content: center;
					align-items: center;
					width: 26vw;
					margin-top: 20rpx;
				}

			}
		}
	}
</style>
